package com.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
  @TableName("s_comment")
@ApiModel(value = "SComment对象", description = "")
public class SComment implements Serializable {

    private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      @ApiModelProperty("评论用户")
        private Integer userId;

      @ApiModelProperty("对应方案")
        private Integer solutionId;

      @ApiModelProperty("父评论id")
      private Integer pid;

      @ApiModelProperty("最上级id")
      private Integer originId;

      @ApiModelProperty("评论内容")
      private String content;

      @ApiModelProperty("生成时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
      private LocalDateTime createTime;

      //用户昵称
      @TableField(exist = false)
      private String nickname;
      //用户头像
      @TableField(exist = false)
      private String profilepic;
      //子评论
      @TableField(exist = false)
      private List<SComment> children;
      //父评论用户昵称
      @TableField(exist = false)
      private String pNickname;
      //父评论用户id
      @TableField(exist = false)
      private Integer pUserId;
      //相对时间
      @TableField(exist = false)
      private String relativeTime;
      //是否为当前用户
      @TableField(exist = false)
      private boolean isMine;
}
